#include<stdio.h>
int main()
{
	long g,s,k;
	long g0,s0,k0;
	long g1,s1,k1;
	scanf("%ld.%ld.%ld %ld.%ld.%ld",&g,&s,&k,&g0,&s0,&k0);
	g1=g0-g;
	s1=s0-s;
	k1=k0-k;
	if(k1<0)
	{
		k1+=29;
		s1--;
	}
	if(s1<0)
	{
		s1+=17;
		g1--;
	}
	if(g1<0)
	{
		g1=g-g0;
		s1=s-s0;
		k1=k-k0;
		if(k1<0)
		{
			k1+=29;
			s1--;
		}
		if(s1<0)
		{
			s1+=17;
			g1--;
		}
		g1=-g1;
	}
	printf("%ld.%ld.%ld\n",g1,s1,k1);
	return 0;
}